I wrote a very simple web extension for Firefox (92.0 on Windows 10).
manifest.json:
{
"manifest_version": 2,
"name": "Sandbox",
"version": "1.0.0",
"description": "my sandbox for a Firefox WebExtension",
"icons": {
"16": "icons/dlwatch16.png",
"32": "icons/dlwatch32.png"
},
"background": {
"scripts": [ "script.js" ]
},
"permissions": [ "<all_urls>", "webNavigation"]
}
script.js:
browser.webNavigation.onBeforeNavigate.addListener((details) => {
console.log(`browser.webNavigation.onBeforeNavigate.listener: details: ${JSON.stringify(details)}`);
});
I start Firefox for a test with "web-ext run -v" that starts a Firefox window. I open the console of Firefox with the menu of the window. When entering https://www.mozilla.org as the URL if the tab, I get in the console:
browser.webNavigation.onBeforeNavigate.listener: details: {"url":"https://www.mozilla.org/","timeStamp":1632494436204,"frameId":0,"parentFrameId":-1,"tabId":1,"windowId":3}
But with the URL "about:addons", The result in the console is:
browser.webNavigation.onBeforeNavigate.listener: details: {"url":"about:addons","timeStamp":1632494444353,"frameId":0,"parentFrameId":-1,"tabId":1,"windowId":3} script.js:2:10 browser.webNavigation.onBeforeNavigate.listener: details: {"url":"about:addons","timeStamp":1632494444416,"frameId":0,"parentFrameId":-1,"tabId":1,"windowId":3} script.js:2:10
Does someone know why the listener is called twice for about:addons ?
New bug report fulfilled in Bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=1732564